<template>
  <div>
    <div class="topNav clear">
      <div class="logo">
        <a href="#">后台管理系统</a>
        <span class="iconfont icon-sangangy"></span>
      </div>
      <ul class="sz">
        <li>基础设置</li>
        <li>系统设置</li>
      </ul>
      <ul class="infor clear">
        <li class="time">{{ time }}</li>
        <li>
          <span class="iconfont icon-xiaoxi_huaban1-copy"></span>
        </li>
        <li>
          <span class="tu"></span>
        </li>
        <li>
          <span>admin</span>
          <span class="xiangxia"></span>
        </li>
        <li>前台首页</li>
      </ul>
    </div>
    <div class="conBox">
      <div class="asideNav">
        <div class="hy">
          <span>图片</span>
          <p>你好！admin, 欢迎回来</p>
        </div>
        <ul class="asnList">
          <li>
            <span class="iconfont icon-lanmuguanli"></span>
            <span class="antype">项目管理</span>
          </li>
          <li>
            <span class="iconfont icon-wenzhangguanli"></span>
            <span class="antype">文章管理</span>
          </li>
          <li>
            <span class="iconfont icon-guanggao"></span>
            <span class="antype">公告管理</span>
          </li>
          <li>
            <span class="iconfont icon-lunboguanli"></span>
            <span class="antype">轮播管理</span>
          </li>
          <li>
            <span class="iconfont icon-fenleiguanli"></span>
            <span class="antype">分类管理</span>
          </li>
          <li>
            <span class="iconfont icon-ziyuan17"></span>
            <span class="antype">评论管理</span>
          </li>
        </ul>
      </div>
      <div class="content">
        <div class="conTop">
          <span>我的桌面</span>
          <b>x</b>
        </div>
        <div class="Conbot">
          <div class="hydl">
            admin欢迎使用后台管理系统！ v1.0 登录次数： 68 登陆时间：
            <span style="color: red;">2019-03-03 16:36</span>
          </div>
          <ul class="data">
            <li>
              <div>
                <i><span class="iconfont icon-guanggao"></span></i>
              </div>
              <p>
                <span>50</span>
                <br />
                <span>会员总数</span>
              </p>
            </li>
            <li>
              <div>
                <i><span class="iconfont icon-guanggao"></span></i>
              </div>
              <p>
                <span>20</span>
                <br />
                <span>友情链接</span>
              </p>
            </li>
            <li>
              <div>
                <i><span class="iconfont icon-guanggao"></span></i>
              </div>
              <p>
                <span>242</span>
                <br />
                <span>文章总数</span>
              </p>
            </li>
            <li>
              <div>
                <i><span class="iconfont icon-guanggao"></span></i>
              </div>
              <p>
                <span>40</span>
                <br />
                <span>公告总数</span>
              </p>
            </li>
          </ul>
          <div class="sjtj">
            <Z></Z>
            <Wtype></Wtype>
            <Wyear></Wyear>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      time: '',
    }
  },
  components: {
    Z: require('./Zhe.vue').default,
    Wtype: require('./Wtype.vue').default,
    Wyear: require('./Wyear.vue').default,
  },
  mounted() {
    setInterval(() => {
      let dt = new Date()
      var year = dt.getFullYear() //年
      var month = dt.getMonth() + 1 //月
      var date = dt.getDate() //日
      var hour = dt.getHours() //时
      var minute = dt.getMinutes() //分
      var second = dt.getSeconds() //秒
      var week = dt.getDay() //周几
      var weekStr = '日一二三四五六'
      function sj(n) {
        if (n < 10) {
          return '0' + n
        }
        return n
      }
      this.time =
        year +
        '-' +
        sj(month) +
        '-' +
        sj(date) +
        '- ' +
        sj(hour) +
        ':' +
        sj(minute) +
        ':' +
        sj(second) +
        ' 星期' +
        weekStr[week]
    }, 1000)
  },
}
</script>

<style lang="scss">
* {
  padding: 0;
  margin: 0;
}
a {
  text-decoration: none;
}
ul {
  list-style: none;
}
.clear:after {
  content: '';
  display: block;
  clear: both;
}
.topNav {
  width: 100%;
  height: 55px;
  color: #fff;
  background: #001529;
  border-bottom: 5px solid #2fb9d4;
  line-height: 60px;
  .logo {
    float: left;
    width: 285px;
    height: 100%;
    a {
      color: #fff;
      margin-left: 50px;
    }
    span {
      margin-left: 70px;
    }
  }
  .sz {
    float: left;
    color: #c2c2c2;
    display: flex;
    font-size: 14px;
    li {
      padding: 0 20px;
      cursor: pointer;
      height: 55px;
      border-bottom: 0px solid transparent;
      transition: all 0.3s;
      &:hover {
        border-bottom: 5px solid #393d49;
      }
    }
  }
  .infor {
    float: right;
    font-size: 14px;
    color: #c2c2c2;
    li {
      float: left;
      margin: 0 5px;

      .icon-xiaoxi_huaban1-copy {
        font-size: 18px;
      }
      .tu {
        width: 39px;
        height: 39px;
        display: inline-block;
        background: turquoise;
        border-radius: 50%;
        margin: 10px 10px 0;
      }
    }
    .time {
      color: #2fb9d4;
      font-size: 18px;
      margin-right: 100px;
    }
    li:last-child {
      margin-right: 50px;
    }
  }
}
.conBox {
  width: 100%;
  height: 100%;
  position: relative;
  .asideNav {
    width: 220px;
    height: 100%;
    background: #001529;
    position: fixed;
    left: 0;
    top: 60px;
    color: #c2c2c2;
    font-size: 14px;
  }
  .hy {
    width: 100%;
    height: 130px;
    margin-top: 10px;
    text-align: center;
    span {
      width: 80px;
      height: 80px;
      display: inline-block;
      border-radius: 50%;
      line-height: 80px;
      background: cornflowerblue;
    }
    p {
      font-size: 12px;
      color: #fff;
      margin-top: 10px;
    }
  }
  .asnList {
    li {
      padding: 0 20px;
      width: 220px;
      height: 45px;
      line-height: 45px;
      box-sizing: border-box;
      border-left: 5px solid transparent;
      cursor: pointer;
      span:first-child {
        margin-right: 10px;
        font-size: 18px;
      }
      &:hover {
        background-color: #4e5465;
        border-left: 5px solid #2fb9d4;
      }
      span:last-child {
        position: relative;
        &::before {
          content: '';
          width: 0;
          height: 0;
          border-style: solid dashed dashed;
          border-color: #c2c2c2 transparent transparent;
          overflow: hidden;
          cursor: pointer;
          transition: all 0.2s;
          -webkit-transition: all 0.2s;
          position: absolute;
          top: 6px;
          right: -100px;
          border-width: 6px;
        }
        &::after {
          content: '';
          width: 0;
          height: 0;
          border-style: solid dashed dashed;
          border-color: transparent transparent #c2c2c2;
          overflow: hidden;
          cursor: pointer;
          transition: all 0.2s;
          -webkit-transition: all 0.2s;
          position: absolute;
          top: 0px;
          right: -100px;
          border-width: 6px;
          display: none;
        }
      }
    }
  }
}
.content {
  width: 100%;
  position: fixed;
  left: 220px;
  border-left: solid 2px #2299ee;
  background: red;
  .conTop {
    width: 100%;
    height: 41px;
    background: #f2f2f2;
    position: absolute;
    z-index: 100;
    span {
      display: inline-block;
      padding: 0 10px;
      width: 84px;
      height: 41px;
      background: #fff;
      line-height: 41px;
    }
    b {
      color: grey;
      margin-left: -20px;
      background: #fff;
    }
  }
  .Conbot {
    margin-top: 60px;
    width: 100%;
    height: 721px;
    position: fixed;
    top: 41px;
    padding: 20px;
    overflow: auto;
    .hydl {
      margin-bottom: 10px;
      padding: 15px;
      line-height: 22px;
      border-left: 5px solid #2fb9d4;
      border-radius: 0 2px 2px 0;
      background-color: #f2f2f2;
    }
    .data {
      display: flex;
      li {
        padding: 0 15px;
        div {
          width: 184px;
          height: 98px;
          background: #f2f2f2;
          i {
            width: 80px;
            height: 80px;
            background: lawngreen;
            display: inline-block;
            text-align: center;
            border-radius: 50%;
            margin-left: 20px;
            line-height: 80px;
            margin-top: 10px;
            span {
              font-size: 42px;
            }
          }
        }
        p {
          color: #fe8463;
          text-align: right;
          span:first-child {
            font-size: 42px;
          }
        }
      }
    }
  }
}
.sjtj {
  margin-top: 50px;
  display: flex;
}
</style>
